'''
配置文件接口
'''
import json

class Config:
    def __init__(self):
        with open("config/config.json", 'r') as f:
            self.config =  json.load(f)

    def __getitem__(self, index):
        return self.config[index]

    def __setitem__(self, index, value):
        self.config[index] = value

        with open("config.json", 'w') as f:
            json.dump(self.config, f)

config = Config()
key = config["Key"]